<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html><html lang="en">
	<head>
		<!--加载header文件-->
		<?php
		include_once 'public/views/header.php';
		?>
		<?php
		include_once 'public/home/html/faltSelect.php';
		?>
		<link rel="stylesheet" href="public/css/edit.css" />
		<script src="cust/js/adminEdit.js"></script>
		<script src="public/js/cus_modal.js"></script>
		<script src="public/home/timetable/exampel/Timetables.min.js"></script>
	</head>
	<style>
        #coursesTable {
            padding: 15px 10px;
        }

        .Courses-head {
            background-color: #edffff;
        }

        .Courses-head > div {
            text-align: center;
            font-size: 14px;
            line-height: 28px;
        }

        .left-hand-TextDom, .Courses-head {
            background-color: #f2f6f7;
        }

        .Courses-leftHand {
            background-color: #f2f6f7;
            font-size: 12px;
        }

        .Courses-leftHand .left-hand-index {
            color: #9c9c9c;
            margin-bottom: 4px !important;
        }

        .Courses-leftHand .left-hand-name {
            color: #666;
        }

        .Courses-leftHand p {
            text-align: center;
            font-weight: 900;
        }

        .Courses-head > div {
            border-left: none !important;
        }

        .Courses-leftHand > div {
            padding-top: 5px;
            border-bottom: 1px dashed rgb(219, 219, 219);
        }

        .Courses-leftHand > div:last-child {
            border-bottom: none !important;
        }

        .left-hand-TextDom, .Courses-head {
            border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
        }

        .Courses-content > ul {
            border-bottom: 1px dashed rgb(219, 219, 219);
            box-sizing: border-box;
        }

        .Courses-content > ul:last-child {
            border-bottom: none !important;
        }

        .highlight-week {
            color: #02a9f5 !important;
        }

        .Courses-content li {
            text-align: center;
            color: #666666;
            font-size: 14px;
            line-height: 50px;
        }

        .Courses-content li span {
            padding: 6px 2px;
            box-sizing: border-box;
            line-height: 18px;
            border-radius: 4px;
            white-space: normal;
            word-break: break-all;
            cursor: pointer;
        }

        .grid-active {
            z-index: 9999;
        }

        .grid-active span {
            box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
        }
    </style>
	<body>
		<div class="role-demo hidden">			
			<div class="btn btn-default btn-xs" onclick="delRole(this);">删除</div></br>
		</div>
		<div class="container">
			<div class="row">
				<input type="hidden" id="modal_height" value="450" />
				<input type="hidden" id='class_id' value='<?=$class_id?>'>
				<div id="coursesTable"></div>
			</div>
		</div>
	</body>
<!-- 	<div id="coursesTable"></div>
<button onclick="onChange()"
        style="background-color: #00a2ae; color: #fff; padding: 5px 10px; border-radius: 4px;border: none">
    切换课表
</button> -->
	<script>
		var class_id=$('#class_id').val();
		$.ajax({
			url: 'Admin/Classes/classDatas/'+class_id,
			type: 'POST',
			dataType: 'json',
			success:function(data){
				if(data.status){
					var t=JSON.parse(data.v);
					var courseList=t;
					var week = window.innerWidth > 360 ? ['周一', '周二', '周三', '周四', '周五'] :
					['一', '二', '三', '四', '五'];
					var day = new Date().getDay();
					var courseType = [
					[{index: '1'}, 1],
					[{index: '2'}, 1],
					[{index: '3'}, 1],
					[{index: '4'}, 1],
					[{index: '5'}, 1],
					[{index: '6'}, 1],
					[{index: '7'}, 1],
					[{index: '8'}, 1],
					];
                      // 实例化(初始化课表)
                      var Timetable = new Timetables({
                      	el: '#coursesTable',
                      	timetables: courseList,
                      	week: week,
                      	timetableType: courseType,
                      	highlightWeek: day,
                      	gridOnClick: function (e) {
                      		// alert(e.name + '  ' + e.week + ', 第' + e.index + '节课, 课长' + e.length + '节');
                      		// console.log(e);
                      	},
                      	styles: {
                      		Gheight: 50
                      	}
                      });
				}else{
                    $("#coursesTable").html(data.msg);
                }
			}
		})		
  


</script>

</html>
